﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RentAWorker.DataAccess.Interfaces;
using RentAWorker.DataAccess.Entities;

namespace RentAWorker.DataAccess.TestClient
{
    class Program
    {
        static void Main(string[] args)
        {
            ILocationAccess locationMgr = new LocationDataAccess();
            IResourceAccess resourceMgr = new ResourceDataAccess();
            ICustomerAccess customerMgr = new CustomerDataAccess();
            IRentalServiceAccess rentalServiceMgr = new RentalServiceDataAccess();


            //var result = resourceMgr.GetAvailableResources("",
            //    DateTime.Now, DateTime.Now.AddDays(1), 1, null);

            //-------------------------------------------------------------------------

            //Customer cust = customerMgr.GetCustomerById(4);
            //Worker worker = (Worker)resourceMgr.GetResource(3);

            //RentalService newRS = new RentalService()
            //{
            //    Customer = cust,
            //    StartDate = DateTime.Now,
            //    EndDate = DateTime.Now.AddDays(2),
            //    RentalServiceState = rentalServiceMgr.GetRentalServiceStates().First(),
            //    Resource = worker
            //};
            //var result = rentalServiceMgr.CreateRentalService(newRS);

            //-------------------------------------------------------------------------

            // Insert
            //Worker res = new Worker()
            //{
            //    Name = "Max Knor",
            //    SSNo = "1234",
            //    Location = locationMgr.GetLocation("Innsbruck").First()
            //};
            //var result = resourceMgr.CreateResource(res);

            // Update
            //Worker worker = resourceMgr.GetResources("M").First() as Worker;
            //if (worker != null)
            //{
            //    worker.Name = "Muh";

            //    resourceMgr.UpdateResource(worker);
            //}


        }
    }
}
